package grape.auth.rest.clientdetails.form;
import grape.common.rest.form.BaseUpdateForm;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/**
 * <p>
 * 服务客户端表
 * </p>
 *
 * @author yangwei
 * @since 2020-03-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="服务客户端更新表单对象")
public class OauthClientDetailsUpdateForm extends BaseUpdateForm {

    private static final long serialVersionUID = 1L;


    @NotEmpty(message="客户端id")
    @ApiModelProperty(value = "客户端id",required = true)
    private String clientId;

    @ApiModelProperty(value = "资源权限")
    private String resourceIds;

    @ApiModelProperty(value = "客户端密码")
    private String clientSecret;

    @NotEmpty(message="授权范围不能为空")
    @ApiModelProperty(value = "授权范围",required = true)
    private String scope;

    @NotEmpty(message="授权类型不能为空")
    @ApiModelProperty(value = "授权类型",required = true)
    private String authorizedGrantTypes;

    @ApiModelProperty(value = "重定向url")
    private String webServerRedirectUri;

    @ApiModelProperty(value = "权限信息")
    private String authorities;

    @NotNull(message="token时长不能为空")
    @ApiModelProperty(value = "token时长(s)",required = true)
    private Integer accessTokenValidity;

    @NotNull(message="刷新token时长不能为空")
    @ApiModelProperty(value = "刷新token时长",required = true)
    private Integer refreshTokenValidity;

    @ApiModelProperty(value = "自动授权")
    private Boolean autoapprove;

}
